package cn.itsource.domain;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @description: 文章表的实体对象
 * @auth: wujiangbo
 * @date: 2022-03-08 11:06
 */
@Data
@Table(name = "blog_article")
public class BlogArticle {

    @Id
    private Long id;

    //文章封面
    @Column(name = "article_pic")
    private String articlePic;

    //文章名称
    @Column(name = "article_name")
    private String articleName;

    //文章标签
    @Column(name = "article_tag")
    private String articleTag;

    //文章简介
    @Column(name = "article_remark")
    private String articleRemark;

    //文章阅读量
    @Column(name = "article_read_count")
    private Integer articleReadCount;

    //文章状态(0:草稿;1:发布;2:弃用)
    @Column(name = "article_state")
    private Integer articleState;

    //作者ID
    @Column(name = "user_id")
    private Long userId;

    //文章内容
    @Column(name = "article_content")
    private String articleContent;

    //最后更新时间
    @Column(name = "update_time")
    private Date updateTime;

    //文章类型
    @Column(name = "article_type")
    private Long articleType;

    //文章点赞数
    @Column(name = "article_star_num")
    private Integer articleStarNum;

    //文章评论数
    @Column(name = "article_comment_num")
    private Integer articleCommentNum;

    //是否置顶(0:不置顶;1:置顶)
    @Column(name = "top_state")
    private Integer topState;

    //作者名称
    @Transient     //  临时字段，只用来装查询出来的结果，不参与当前实体类对应的表的增删改操作
    private String realName;

    //文章类型名称
    @Transient
    private String articleTypeName;
}